# This program is to generate and normalize 
#  train dataset and test dataset
data = read.table("../../data/Prostate/Prostate.txt",header=TRUE,sep="\t")
data$pgg45 = data$pgg45/100
data$gleason = data$gleason/100

# normalization
data.normal = data[,-length(data)]
data.normal[,-length(data.normal)]=scale(data.normal[,-length(data.normal)])

# generate normal train data and normal test data
train.data.normal = data.normal[data$train,]
save(file="train.data.normal.rda",train.data.normal)
test.data.normal = data.normal[!data$train,]
save(file="test.data.normal.rda",test.data.normal)

# generate train data and normal data
train.data = data[data$train,-10]
save(file="train.data.rda",train.data)
test.data = data[!data$train,-10]
save(file="test.data.rda",test.data)
